package com.ruoyi.wareManagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wareManagement.mapper.TnventoryWarningMapper;
import com.ruoyi.wareManagement.domain.TnventoryWarning;
import com.ruoyi.wareManagement.service.ITnventoryWarningService;

/**
 * 库存预警查询Service业务层处理
 * 
 * @author admin
 * @date 2024-07-01
 */
@Service
public class TnventoryWarningServiceImpl implements ITnventoryWarningService 
{
    @Autowired
    private TnventoryWarningMapper tnventoryWarningMapper;

    /**
     * 查询库存预警查询
     * 
     * @param warningId 库存预警查询主键
     * @return 库存预警查询
     */
    @Override
    public TnventoryWarning selectTnventoryWarningByWarningId(Long warningId)
    {
        return tnventoryWarningMapper.selectTnventoryWarningByWarningId(warningId);
    }

    /**
     * 查询库存预警查询列表
     * 
     * @param tnventoryWarning 库存预警查询
     * @return 库存预警查询
     */
    @Override
    public List<TnventoryWarning> selectTnventoryWarningList(TnventoryWarning tnventoryWarning)
    {
        return tnventoryWarningMapper.selectTnventoryWarningList(tnventoryWarning);
    }

    /**
     * 新增库存预警查询
     * 
     * @param tnventoryWarning 库存预警查询
     * @return 结果
     */
    @Override
    public int insertTnventoryWarning(TnventoryWarning tnventoryWarning)
    {
        tnventoryWarning.setCreateTime(DateUtils.getNowDate());
        return tnventoryWarningMapper.insertTnventoryWarning(tnventoryWarning);
    }

    /**
     * 修改库存预警查询
     * 
     * @param tnventoryWarning 库存预警查询
     * @return 结果
     */
    @Override
    public int updateTnventoryWarning(TnventoryWarning tnventoryWarning)
    {
        return tnventoryWarningMapper.updateTnventoryWarning(tnventoryWarning);
    }

    /**
     * 批量删除库存预警查询
     * 
     * @param warningIds 需要删除的库存预警查询主键
     * @return 结果
     */
    @Override
    public int deleteTnventoryWarningByWarningIds(Long[] warningIds)
    {
        return tnventoryWarningMapper.deleteTnventoryWarningByWarningIds(warningIds);
    }

    /**
     * 删除库存预警查询信息
     * 
     * @param warningId 库存预警查询主键
     * @return 结果
     */
    @Override
    public int deleteTnventoryWarningByWarningId(Long warningId)
    {
        return tnventoryWarningMapper.deleteTnventoryWarningByWarningId(warningId);
    }
}
